package com.kangye.game.service.impl;

import com.kangye.game.mapper.GamePriceMapper;
import com.kangye.game.pojo.Game;
import com.kangye.game.service.GamePriceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 15832
 * @Description TODO
 * @Date 2021/9/1 11:43
 * @Version 1.0
 */
@Service("gamePriceService")
public class GamePriceServiceImpl implements GamePriceService {

    @Resource
    private GamePriceMapper gamePriceMapper;

    /**
     * 获取游戏轮播
     * @return
     */
    @Override
    public List<Game> getGameShow() {
        List<Game> list = gamePriceMapper.getGameShow();
        return list.size() > 0 ? list : null;
    }

    /**
     * 点击轮播图进入具体信息页面
     * @param id 游戏id
     * @return
     */
    @Override
    public Game getGame(String id) {
        Game game = gamePriceMapper.getGame(id);
        return game != null ? game : null;
    }

    /**
     * 获取对应游戏任务
     * @param id
     * @return
     */
    @Override
    public List<Game> getTask(String id) {
        List<Game> list = gamePriceMapper.getTask(id);
        return list.size() > 0 ? list : null;
    }
}
